<template>
    <div class="shawbs-form">
        <slot />
    </div>
</template>

<script>
    export default {
        name: 'ShawbsForm',
        props: {
            model: Object,
            rules: Object
        },
        data(){
            return {
                name: 'shawbsForm',
                fields: []
            }
        },
        methods: {
            check(callback) {
                const arr = []
                this.fields.forEach((item) => {
                    const valid = item.check()
                    if (!valid) {
                        arr.push(valid)
                    }
                })
                // console.log(arr)
                callback(arr.length === 0)
            }
        }
        
    }
</script>

<style lang="less">

</style>